package pers.mingshan.thread.thread;

public class JoinTest {

    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName() + " 主线程运行开始");
        JoinClassDemo j1=new JoinClassDemo("haha");
        JoinClassDemo j2=new JoinClassDemo("zzz");

        j1.start();
        j2.start();

        try {
            j1.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        try {
            j2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(Thread.currentThread().getName()+" 主线程运行结束");
    }
}

